﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Windows;
using ReflectionStudio.Core.Events;
using System.Runtime.Serialization;
namespace WPFExcelReport
{
    public partial class UIWBBST : ViewBase
    {
        public TDRAUFTR cDR
        {
            get
            {
                return (TDRAUFTR)this.FindName("cDR");

            }
        }
        public UIWBBST()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
        }

        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            dwWB = dwMaster;
            try
            {
                if (dwMaster == null)
                {
                    WAART = "";
                    TAX = "";
                    RWKRS = "";
                    RWLFD = "";
                    KEY = "";                     
                }
                else
                {
                    WAART =TMV.WBBWAKZ+ TMV.WBBART + TMV.WBBVAR;
                    TAX = TMV.WBBTAX;
                    RWKRS = TMV.WBBRWKRS;
                    RWLFD = TMV.WBBRWLFD;
                    KEY = TMV.WBBSTKNR;
                    BRT = TMV.WBBIBRT;
                }
             }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        }
        public virtual void OnQUALITYChg(string quality)
        {
            if (dwMaster == null)
                return;
            if (quality.Length < 2)
                return;
            TMV.WBBZENSUR = quality.Substring(0, 1);
            TMV.WBBZENSURKZ = quality.Substring(1, 1); 
        }
        public virtual void OnRWAUFChg(string value)
        {

        }
        public virtual void OnSTKNRChg(string value)
        {

        }
        
        public virtual void OnVVTChg(string value)
        {

        }

        public virtual void OnWB61VVTChg(string value)
        {

        }
        public virtual void OnIsShowChg(bool value)
        {
            if (!value)
                return;
            LOADBYAUF();
         }
        public void BATCHCONFIRM(object sender, RoutedEventArgs e)
        {
            TMV.VWBW.POSTCHG();
        }
        public virtual void QIHelper()
        { 
            PM["STKNR"] = TMV.WBBSTKNR;
            PM["IsJP"] = IsJP;
            TMV.QICOMBINEWB(PM);
        }
        public virtual void PrintChg()
        {
            if (!IsPrint)
                return;
            if (cDR == null)
                return;
            bool IsFound = false;
            if (dwMaster == null)
                return;
            QIHelper();
           
            if (PRNLB.Trim() == "")
                return;
            DataTable tb = TBMain.Clone();
            DataRow _dwWB = tb.Rows.Add();
            _dwWB.ItemArray = dwMaster.ItemArray;
            DataSet Set = new DataSet();
            Set.Merge(tb);
            cDR.DocType = PRNLB;
            cDR.PRINT(Set);
            _dwWB["WBBDRKZ1"] = "J";
            TMV.UWB06(_dwWB); 
        }
        public void PrintLBCommand(object sender, RoutedEventArgs e)
        {
            IsPrint = false;
            IsPrint = true;
        }

    }
    public partial class UIWBBST
    {
        public VWBBST TMV
        {
            get
            {
                return (VWBBST)MV;
            }
        }
        #region ==TTPOINTS=========
        public static readonly DependencyProperty TTPOINTSProperty = DependencyProperty.Register("TTPOINTS",
            typeof(double), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTTPOINTSChanged));
        public double TTPOINTS
        {
            get
            {
                return (double)GetValue(TTPOINTSProperty);
            }
            set
            {
                SetValue(TTPOINTSProperty, value);
            }
        }
        private static void OnTTPOINTSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.TTPOINTS = (double)e.NewValue;
                src.OnTTPONSTsChg((double)e.NewValue);
            }
        }
        public virtual void OnTTPONSTsChg(double points)
        { }
        #endregion

        #region ==IsFQI===========
        public static readonly DependencyProperty IsFQIProperty = DependencyProperty.Register("IsFQI",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsFQIChanged));
        public bool IsFQI
        {
            get
            {
                return (bool)GetValue(IsFQIProperty);
            }
            set
            {
                SetValue(IsFQIProperty, value);
            }
        }
        private static void OnIsFQIChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsFQI = (bool)e.NewValue;
            }
        }
        #endregion
        
        #region ==CPCS===========
        public static readonly DependencyProperty CPCSProperty = DependencyProperty.Register("CPCS",
            typeof(int), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCPCSChanged));
        public int CPCS
        {
            get
            {
                return (int)GetValue(CPCSProperty);
            }
            set
            { 
                SetValue(CPCSProperty, value);
            }
        }
        private static void OnCPCSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.CPCS = (int)e.NewValue;
            }
        }
        #endregion 
       
        #region ==dwAB===========
        public static readonly DependencyProperty dwABProperty = DependencyProperty.Register("dwAB",
            typeof(DataRow), typeof(UIWBBST),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwABChanged));
        public DataRow dwAB
        {
            get
            {
                return (DataRow)GetValue(dwABProperty);
            }
            set
            {
                SetValue(dwABProperty, value); 
            }
        }
        private static void OndwABChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.dwAB = (DataRow)e.NewValue;
            }
        }
        #endregion 
       
        #region ==Is2CW===========
        public static readonly DependencyProperty Is2CWProperty = DependencyProperty.Register("Is2CW",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIs2CWChanged));
        public bool Is2CW
        {
            get
            {
                return (bool)GetValue(Is2CWProperty);
            }
            set
            {
                SetValue(Is2CWProperty, value);
            }
        }
        private static void OnIs2CWChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.Is2CW = (bool)e.NewValue;
            }
        }
        #endregion 

        #region ==IsDBChg===========
        public static readonly DependencyProperty IsDBChgProperty = DependencyProperty.Register("IsDBChg",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsDBChgChanged));
        public bool IsDBChg
        {
            get
            {
                return (bool)GetValue(IsDBChgProperty);
            }
            set
            {
                SetValue(IsDBChgProperty, value);
                OnDBChg();
            }
        }
        private static void OnIsDBChgChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsDBChg = (bool)e.NewValue;
            }
        }
        public virtual void OnDBChg()
        { }
        #endregion

        #region ==IsWZChg===========
        public static readonly DependencyProperty IsWZChgProperty = DependencyProperty.Register("IsWZChg",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsWZChgChanged));
        public bool IsWZChg
        {
            get
            {
                return (bool)GetValue(IsWZChgProperty);
            }
            set
            {
                SetValue(IsWZChgProperty, value);
               
            }
        }
        private static void OnIsWZChgChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsWZChg = (bool)e.NewValue;
                src.OnWZChg((bool)e.NewValue);
            }
        }
        public virtual void OnWZChg(bool value)
        { }
        #endregion

        #region ==IsPrint===========
        public static readonly DependencyProperty IsPrintProperty = DependencyProperty.Register("IsPrint",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsPrintChanged));
        public bool IsPrint
        {
            get
            {
                return (bool)GetValue(IsPrintProperty);
            }
            set
            { 
                SetValue(IsPrintProperty, value);
             }
        }
        private static void OnIsPrintChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsPrint = (bool)e.NewValue;
                src.PrintChg();
            }
        }
         
        #endregion

        #region ==IsVV===========
        public static readonly DependencyProperty IsVVProperty = DependencyProperty.Register("IsVV",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsVVChanged));
        public bool IsVV
        {
            get
            {
                return (bool)GetValue(IsVVProperty);
            }
            set
            {
                SetValue(IsVVProperty, value);
            }
        }
        private static void OnIsVVChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsVV = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==IsShow===========
        public static readonly DependencyProperty IsShowProperty = DependencyProperty.Register("IsShow",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsShowChanged));
        public bool IsShow
        {
            get
            {
                return (bool)GetValue(IsShowProperty);
            }
            set
            {
                SetValue(IsShowProperty, value);
                OnIsShowChg(value);
            }
        }
        private static void OnIsShowChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsShow = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==VVT===========
        public static readonly DependencyProperty VVTProperty = DependencyProperty.Register("VVT",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVVTChanged));
        public string VVT
        {
            get
            {
                return (string)GetValue(VVTProperty);
            }
            set
            {
                SetValue(VVTProperty, value);
                OnVVTChg(value);
            }
        }
        private static void OnVVTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.VVT = (string)e.NewValue;
            }
        }
        #endregion

        #region ==WB61VVT===========
        public static readonly DependencyProperty WB61VVTProperty = DependencyProperty.Register("WB61VVT",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWB61VVTChanged));
        public string WB61VVT
        {
            get
            {
                return (string)GetValue(WB61VVTProperty);
            }
            set
            {
                SetValue(WB61VVTProperty, value);
                OnWB61VVTChg(value);
            }
        }
        private static void OnWB61VVTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.WB61VVT = (string)e.NewValue;
            }
        }
        #endregion

        #region ==dwWS===========
        public static readonly DependencyProperty dwWSProperty = DependencyProperty.Register("dwWS",
            typeof(DataRow), typeof(UIWBBST),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwWSChanged));
        public DataRow dwWS
        {
            get
            {
                return (DataRow)GetValue(dwWSProperty);
            }
            set
            {
                SetValue(dwWSProperty, value);
            }
        }
        private static void OndwWSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.dwWS = (DataRow)e.NewValue;
            }
        }
        #endregion

        #region ==dwWB04===========
        public static readonly DependencyProperty dwWB04Property = DependencyProperty.Register("dwWB04",
            typeof(DataRow), typeof(UIWBBST),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwWB04Changed));
        public DataRow dwWB04
        {
            get
            {
                return (DataRow)GetValue(dwWB04Property);
            }
            set
            {
                SetValue(dwWB04Property, value);
                TMV.dwWB04 = value;
                if (vwMaster.View != null)
                {
                    vwMaster.View.MoveCurrentToFirst();
                }
            }
        }
        private static void OndwWB04Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.dwWB04 = (DataRow)e.NewValue;
            }
        }
        #endregion

        #region ==dwWB===========
        public static readonly DependencyProperty dwWBProperty = DependencyProperty.Register("dwWB",
            typeof(DataRow), typeof(UIWBBST),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwWBChanged));
        public DataRow dwWB
        {
            get
            {
                return (DataRow)GetValue(dwWBProperty);
            }
            set
            {
                SetValue(dwWBProperty, value);
            }
        }
        private static void OndwWBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.dwWB = (DataRow)e.NewValue;
            }
        }
        #endregion

        #region ==FTAUTOWB===========
        public static readonly DependencyProperty FTAUTOWBProperty = DependencyProperty.Register("FTAUTOWB",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnFTAUTOWBChanged));
        public bool FTAUTOWB
        {
            get
            {
                return (bool)GetValue(FTAUTOWBProperty);
            }
            set
            {
                SetValue(FTAUTOWBProperty, value);
                if (MV == null) return;
                TMV.FTAUTOWB = value;
            }
        }
        private static void OnFTAUTOWBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.FTAUTOWB = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==RWAUF===========
        public static readonly DependencyProperty RWAUFProperty = DependencyProperty.Register("RWAUF",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnRWAUFChanged));
        public string RWAUF
        {
            get
            {
                return (string)GetValue(RWAUFProperty);
            }
            set
            {
                SetValue(RWAUFProperty, value);
                OnRWAUFChg(value);
            }
        }
        private static void OnRWAUFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.RWAUF = (string)e.NewValue;
            }
        }
        #endregion

        #region ==FRWAUF===========
        public static readonly DependencyProperty FRWAUFProperty = DependencyProperty.Register("FRWAUF",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnFRWAUFChanged));
        public string FRWAUF
        {
            get
            {
                return (string)GetValue(FRWAUFProperty);
            }
            set
            {
                SetValue(FRWAUFProperty, value);
                OnFRWAUFChg();
            }
        }
        private static void OnFRWAUFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.FRWAUF = (string)e.NewValue;
            }
        }
        public virtual void OnFRWAUFChg()
        { }
        #endregion

        #region ==IsNOTFull===========
        public static readonly DependencyProperty IsNOTFullProperty = DependencyProperty.Register("IsNOTFull",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsNOTFullChanged));
        public bool IsNOTFull
        {
            get
            {
                return (bool)GetValue(IsNOTFullProperty);
            }
            set
            {
                SetValue(IsNOTFullProperty, value);
                if (MV == null)
                    return;
                TMV.IsNOTFull = value;
            }
        }
        private static void OnIsNOTFullChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsNOTFull = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==IsVVLIEF===========
        public static readonly DependencyProperty IsVVLIEFProperty = DependencyProperty.Register("IsVVLIEF",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsVVLIEFChanged));
        public bool IsVVLIEF
        {
            get
            {
                return (bool)GetValue(IsVVLIEFProperty);
            }
            set
            {
                SetValue(IsVVLIEFProperty, value);
            }
        }
        private static void OnIsVVLIEFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsVVLIEF = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==IsFreeWB===========
        public static readonly DependencyProperty IsFreeWBProperty = DependencyProperty.Register("IsFreeWB",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsFreeWBChanged));
        public bool IsFreeWB
        {
            get
            {
                return (bool)GetValue(IsFreeWBProperty);
            }
            set
            {
                SetValue(IsFreeWBProperty, value);
                TMV.IsFreeWB = value;
            }
        }
        private static void OnIsFreeWBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsFreeWB = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==IsWZVV===========
        public static readonly DependencyProperty IsWZVVProperty = DependencyProperty.Register("IsWZVV",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsWZVVChanged));
        public bool IsWZVV
        {
            get
            {
                return (bool)GetValue(IsWZVVProperty);
            }
            set
            {
                SetValue(IsWZVVProperty, value);
                TMV.IsWZVV = value;
            }
        }
        private static void OnIsWZVVChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsWZVV = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==TargetMTR===========
        public static readonly DependencyProperty TargetMTRProperty = DependencyProperty.Register("TargetMTR",
            typeof(double), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTargetMTRChanged));

        public double TargetMTR
        {
            get
            {
                return TMV.TargetMTR;
            }
            set
            {
                TMV.TargetMTR = value;
            }
        }
        private static void OnTargetMTRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.TargetMTR = (double)e.NewValue;
            }
        }
        #endregion

        #region ==LIEFSCH===========
        public static readonly DependencyProperty LIEFSCHProperty = DependencyProperty.Register("LIEFSCH",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLIEFSCHChanged));
        public string LIEFSCH
        {
            get
            {
                return (string)GetValue(LIEFSCHProperty);
            }
            set
            {
                SetValue(LIEFSCHProperty, value);
                TMV.LIEFSCH = value;
            }
        }
        private static void OnLIEFSCHChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.LIEFSCH = (string)e.NewValue;
            }
        }
        #endregion

        #region ==WBROWS===========

        public List<DataRow> WBROWS
        {
            get
            {
                return TMV.WBROWS;
            }
            set
            {
                TMV.WBROWS = value;
            }
        }

        #endregion

        #region ==TAX===========
        public static readonly DependencyProperty TAXProperty = DependencyProperty.Register("TAX",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTAXChanged));
        public string TAX
        {
            get
            {
                return (string)GetValue(TAXProperty);
            }
            set
            {
                SetValue(TAXProperty, value);
                if (dwWB != null)
                {
                    dwWB["WBBTAX"] = value;
                }
            }
        }
        private static void OnTAXChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.TAX = (string)e.NewValue;
            }
        }
        #endregion

        #region ==AUFTYP===========
        public static readonly DependencyProperty AUFTYPProperty = DependencyProperty.Register("AUFTYP",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnAUFTYPChanged));
        public string AUFTYP
        {
            get
            {
                return (string)GetValue(AUFTYPProperty);
            }
            set
            {
                SetValue(AUFTYPProperty, value);
                TMV.AUFTYP = value;
            }
        }
        private static void OnAUFTYPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.AUFTYP = (string)e.NewValue;
            }
        }
        #endregion

        #region ==PRNLB===========
        public static readonly DependencyProperty PRNLBProperty = DependencyProperty.Register("PRNLB",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPRNLBChanged));
        public string PRNLB
        {
            get
            {
                return (string)GetValue(PRNLBProperty);
            }
            set
            {
                SetValue(PRNLBProperty, value);
            }
        }
        private static void OnPRNLBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.PRNLB = (string)e.NewValue;
            }
        }
        #endregion
        #region ==WAART===========
        public static readonly DependencyProperty WAARTProperty = DependencyProperty.Register("WAART",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWAARTChanged));
        public string WAART
        {
            get
            {
                return (string)GetValue(WAARTProperty);
            }
            set
            {
                SetValue(WAARTProperty, value);
            }
        }
        private static void OnWAARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.WAART = (string)e.NewValue;
            }
        }
        #endregion

        #region ==WFART===========
        public static readonly DependencyProperty WFARTProperty = DependencyProperty.Register("WFART",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWFARTChanged));
        public string WFART
        {
            get
            {
                return (string)GetValue(WFARTProperty);
            }
            set
            {
                SetValue(WFARTProperty, value);
            }
        }
        private static void OnWFARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.WFART = (string)e.NewValue;
            }
        }
        #endregion

        #region ==TBWB===========
        public static readonly DependencyProperty TBWBProperty = DependencyProperty.Register("TBWB",
            typeof(DataTable), typeof(UIWBBST),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTBWBChanged));
        public DataTable TBWB
        {
            get
            {
                return (DataTable)GetValue(TBWBProperty);
            }
            set
            {
                SetValue(TBWBProperty, value);
            }
        }
        private static void OnTBWBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.TBWB = (DataTable)e.NewValue;
            }
        }
        #endregion

       

        #region ==RWKRS===========
        public static readonly DependencyProperty RWKRSProperty = DependencyProperty.Register("RWKRS",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnRWKRSChanged));
        public string RWKRS
        {
            get
            {
                return (string)GetValue(RWKRSProperty);
            }
            set
            {
                SetValue(RWKRSProperty, value);
                TMV.RWKRS = value;
            }
        }
        private static void OnRWKRSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.RWKRS = (string)e.NewValue;
            }
        }
        #endregion

        #region ==RWLFD===========
        public static readonly DependencyProperty RWLFDProperty = DependencyProperty.Register("RWLFD",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnRWLFDChanged));
        public string RWLFD
        {
            get
            {
                return (string)GetValue(RWLFDProperty);
            }
            set
            {
                SetValue(RWLFDProperty, value);
                TMV.RWLFD = value;
            }
        }
        private static void OnRWLFDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.RWLFD = (string)e.NewValue;
            }
        }
        #endregion

        #region ==SLO===========
        public static readonly DependencyProperty SLOProperty = DependencyProperty.Register("SLO",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSLOChanged));
        public string SLO
        {
            get
            {
                return (string)GetValue(SLOProperty);
            }
            set
            {
                SetValue(SLOProperty, value);
            }
        }
        private static void OnSLOChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.SLO = (string)e.NewValue;
            }
        }
        #endregion

        #region ==SLB===========
        public static readonly DependencyProperty SLBProperty = DependencyProperty.Register("SLB",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSLBChanged));
        public string SLB
        {
            get
            {
                return (string)GetValue(SLBProperty);
            }
            set
            {
                SetValue(SLBProperty, value);
            }
        }
        private static void OnSLBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.SLB = (string)e.NewValue;
            }
        }
        #endregion

        #region ==STKNR===========
        public static readonly DependencyProperty STKNRProperty = DependencyProperty.Register("STKNR",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSTKNRChanged));
        public string STKNR
        {
            get
            {
                return (string)GetValue(STKNRProperty);
            }
            set
            {
                SetValue(STKNRProperty, value);
               
            }
        }
        private static void OnSTKNRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.STKNR = (string)e.NewValue;
                src.OnSTKNRChg((string)e.NewValue);
            }
        }
        #endregion

        #region ==NSTKNR===========
        public static readonly DependencyProperty NSTKNRProperty = DependencyProperty.Register("NSTKNR",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnNSTKNRChanged));
        public string NSTKNR
        {
            get
            {
                return (string)GetValue(NSTKNRProperty);
            }
            set
            {
                SetValue(NSTKNRProperty, value); 
            }
        }
        private static void OnNSTKNRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.NSTKNR = (string)e.NewValue;
                src.OnNSTKNRChg();
            }
        }
        public virtual void OnNSTKNRChg()
        { }
        #endregion

        #region ==CMTR===========
        public static readonly DependencyProperty CMTRProperty = DependencyProperty.Register("CMTR",
            typeof(double), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCMTRChanged));
        public double CMTR
        {
            get
            {
                return (double)GetValue(CMTRProperty);
            }
            set
            {
                SetValue(CMTRProperty, value);
               
            }
        }
        private static void OnCMTRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                double mtr = (double)e.NewValue; 
                src.CMTR = mtr;
                src.OnCMTRChg(mtr);
            }
        }
        public virtual void OnCMTRChg(double cmtr)
        { }
        #endregion

        #region ==CKG===========
        public static readonly DependencyProperty CKGProperty = DependencyProperty.Register("CKG",
            typeof(double), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCKGChanged));
        public double CKG
        {
            get
            {
                return (double)GetValue(CKGProperty);
            }
            set
            {
                SetValue(CKGProperty, value);
                OnCKGChg();
            }
        }
        private static void OnCKGChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.CKG = (double)e.NewValue;
            }
        }
        public virtual void OnCKGChg()
        { }
        #endregion

        #region ==IsZoneWBFull===========
        public static readonly DependencyProperty IsZoneWBFullProperty = DependencyProperty.Register("IsZoneWBFull",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsZoneWBFullChanged));
        public bool IsZoneWBFull
        {
            get
            {
                return (bool)GetValue(IsZoneWBFullProperty);
            }
            set
            {
                SetValue(IsZoneWBFullProperty, value);
                OnIsZoneWBFullChg(value);
            }
        }
        private static void OnIsZoneWBFullChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsZoneWBFull = (bool)e.NewValue;
            }
        }
        public void OnIsZoneWBFullChg(bool value)
        {
        }

        #endregion

        #region ==EKAUF===========
        public static readonly DependencyProperty EKAUFProperty = DependencyProperty.Register("EKAUF",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnEKAUFChanged));
        public string EKAUF
        {
            get
            {
                return (string)GetValue(EKAUFProperty);
            }
            set
            {
                SetValue(EKAUFProperty, value);
            }
        }
        private static void OnEKAUFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.EKAUF = (string)e.NewValue;
            }
        }
        #endregion

        #region ==ABAUF===========
        public static readonly DependencyProperty ABAUFProperty = DependencyProperty.Register("ABAUF",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnABAUFChanged));
        public string ABAUF
        {
            get
            {
                return (string)GetValue(ABAUFProperty);
            }
            set
            {
                SetValue(ABAUFProperty, value);
                OnABAUFChg(value);
            }
        }

        private static void OnABAUFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.ABAUF = (string)e.NewValue;
            }
        }

        public virtual void OnABAUFChg(string vlaue)
        {
        }

        #endregion

        #region ==LOOM===========
        public static readonly DependencyProperty LOOMProperty = DependencyProperty.Register("LOOM",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLOOMChanged));
        public string LOOM
        {
            get
            {
                return (string)GetValue(LOOMProperty);
            }
            set
            {
                SetValue(LOOMProperty, value);
                OnLOOMChg(value);
            }
        }

        private static void OnLOOMChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.LOOM = (string)e.NewValue;
            }
        }

        public virtual void OnLOOMChg(string vlaue)
        {
        }

        #endregion

        #region ==ERVER===========
        public static readonly DependencyProperty ERVERProperty = DependencyProperty.Register("ERVER",
            typeof(int), typeof(UIWBBST),
            new FrameworkPropertyMetadata(1, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnERVERChanged));
        public int ERVER
        {
            get
            {
                return (int)GetValue(ERVERProperty);
            }
            set
            {
                SetValue(ERVERProperty, value);
                OnERVERChg();
            }
        }

        private static void OnERVERChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.ERVER = (int)e.NewValue;
            }
        }

        public virtual void OnERVERChg()
        {
        }

        #endregion

        #region ==MACHINEID===========
        public static readonly DependencyProperty MACHINEIDProperty = DependencyProperty.Register("MACHINEID",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnMACHINEIDChanged));
        public string MACHINEID
        {
            get
            {
                return (string)GetValue(MACHINEIDProperty);
            }
            set
            {
                SetValue(MACHINEIDProperty, value);
                OnMACHINEIDChg();
            }
        }
        private static void OnMACHINEIDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.MACHINEID = (string)e.NewValue;
            }
        }
        public virtual void OnMACHINEIDChg()
        { }
        #endregion 

        #region ==QUALITY===========
        public static readonly DependencyProperty QUALITYProperty = DependencyProperty.Register("QUALITY",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("1A", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnQUALITYChanged));
        public string QUALITY
        {
            get
            {
                return (string)GetValue(QUALITYProperty);
            }
            set
            {
                SetValue(QUALITYProperty, value);
               
            }
        }
        private static void OnQUALITYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.QUALITY = (string)e.NewValue;
                src.OnQUALITYChg((string)e.NewValue);
            }
        } 
        #endregion

        #region ==TP===========
        public static readonly DependencyProperty TPProperty = DependencyProperty.Register("TP",
            typeof(double), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTPChanged));
        public double TP
        {
            get
            {
                return (double)GetValue(TPProperty);
            }
            set
            {
                SetValue(TPProperty, value);
                OnTPChg();
            }
        }
        private static void OnTPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.TP = (double)e.NewValue;
            }
        }
        public virtual void OnTPChg()
        { }
        #endregion

        #region ==FOL===========
        public static readonly DependencyProperty FOLProperty = DependencyProperty.Register("FOL",
            typeof(double), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnFOLChanged));
        public double FOL
        {
            get
            {
                return (double)GetValue(FOLProperty);
            }
            set
            {
                SetValue(FOLProperty, value);
                OnFOLChg();
            }
        }
        private static void OnFOLChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.FOL = (double)e.NewValue;
            }
        }
        public virtual void OnFOLChg()
        { }
        #endregion

        #region ==LOOMID===========
        public static readonly DependencyProperty LOOMIDProperty = DependencyProperty.Register("LOOMID",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLOOMIDChanged));
        public string LOOMID
        {
            get
            {
                return (string)GetValue(LOOMIDProperty);
            }
            set
            {
                SetValue(LOOMIDProperty, value);
                OnLOOMIDChg();
            }
        }
        private static void OnLOOMIDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.LOOMID = (string)e.NewValue;
            }
        }
        public virtual void OnLOOMIDChg()
        { }
        #endregion 

        #region ==EXORD===========
        public static readonly DependencyProperty EXORDProperty = DependencyProperty.Register("EXORD",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnEXORDChanged));
        public string EXORD
        {
            get
            {
                return (string)GetValue(EXORDProperty);
            }
            set
            {
                SetValue(EXORDProperty, value);
                OnEXORDChg();
            }
        }
        private static void OnEXORDChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.EXORD = (string)e.NewValue;
            }
        }
        public virtual void OnEXORDChg()
        { }
        #endregion 

        #region ==IsAppend===========
        public static readonly DependencyProperty IsAppendProperty = DependencyProperty.Register("IsAppend",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsAppendChanged));
        public bool IsAppend
        {
            get
            {
                return (bool)GetValue(IsAppendProperty);
            }
            set
            {
                SetValue(IsAppendProperty, value); 
            }
        }
        private static void OnIsAppendChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsAppend = (bool)e.NewValue;
                src.OnIsAppendChg((bool)e.NewValue);
            }
        }
        public virtual void OnIsAppendChg(bool _IsAppend)
        {

        }
        #endregion

        #region ==IsJP===========
        public static readonly DependencyProperty IsJPProperty = DependencyProperty.Register("IsJP",
            typeof(bool), typeof(UIWBBST),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsJPChanged));
        public bool IsJP
        {
            get
            {
                return (bool)GetValue(IsJPProperty);
            }
            set
            {
                SetValue(IsJPProperty, value);
                
            }
        }
        private static void OnIsJPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.IsJP = (bool)e.NewValue;
                src.OnIsJPChg((bool)e.NewValue);
            }
        }
        public virtual void OnIsJPChg(bool _IsJP)
        {

        }
        #endregion

        #region ==PACKNR===========
        public static readonly DependencyProperty PACKNRProperty = DependencyProperty.Register("PACKNR",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPACKNRChanged));
        public string PACKNR
        {
            get
            {
                return (string)GetValue(PACKNRProperty);
            }
            set
            {
                SetValue(PACKNRProperty, value);
                OnPACKNRChg();
            }
        }
        private static void OnPACKNRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.PACKNR = (string)e.NewValue;
            }
        }
        public virtual void OnPACKNRChg()
        { }
        #endregion 

        #region ==BRT===========
        public static readonly DependencyProperty BRTProperty = DependencyProperty.Register("BRT",
            typeof(double), typeof(UIWBBST),
            new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnBRTChanged));
        public double BRT
        {
            get
            {
                return (double)GetValue(BRTProperty);
            }
            set
            {
                SetValue(BRTProperty, value);
                OnBRTChg();
            }
        }
        private static void OnBRTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.BRT = (double)e.NewValue;
            }
        }
        public virtual void OnBRTChg()
        { }
        #endregion

        #region ==DFFSCHL===========
        public static readonly DependencyProperty DFFSCHLProperty = DependencyProperty.Register("DFFSCHL",
            typeof(string), typeof(UIWBBST),
            new FrameworkPropertyMetadata("   ", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnDFFSCHLChanged));
        public string DFFSCHL
        {
            get
            {
                return (string)GetValue(DFFSCHLProperty);
            }
            set
            {
                SetValue(DFFSCHLProperty, value);
                OnDFFSCHLChg();
            }
        }

        private static void OnDFFSCHLChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIWBBST;
            if (src != null)
            {
                src.DFFSCHL = (string)e.NewValue;
            }
        }

        public virtual void OnDFFSCHLChg()
        {
        }

        #endregion


    }
}
